package com.java.oop;

public abstract class Human {
    public Human(){
        System.out.println("Human构造方法");
    }
    /**
     * 抽象方法
     */
    public abstract void eat();

    public static void main(String[] args) {
        //Human human = new Human();
        Chinese chinese = new Chinese();
        American american = new American();
        Indian indian = new Indian();
        chinese.eat();
        american.eat();
        indian.eat();
    }
}

//中国人 重写eat方法
class Chinese extends Human{
    public void eat(){
        System.out.println("中国人用筷子吃饭");
    }
}

class American extends Human{
    public void eat(){
        System.out.println("美国人用刀叉吃饭");
    }
}

class Indian extends Human{
    public void eat(){
        System.out.println("印度人用手抓吃饭");
    }
}
